package org.wii.base.context;

import org.wii.base.user.UserBaseInfo;

/**
 * 用户上下文信息
 * @author tanghong on 2022/12/23
 */
public class UserInfoContextHolder {
    private static final InheritableThreadLocal<UserBaseInfo> USER_INFO = new InheritableThreadLocal<>();

    public static void setUserInfo(UserBaseInfo userInfo) {
        USER_INFO.set(userInfo);
    }

    public static UserBaseInfo getUserInfo() {
        return USER_INFO.get();
    }

    public static void removeUserInfo() {
        USER_INFO.remove();
    }
}
